// To compile and install:
//   avr-gcc -DF_CPU=16000000UL -mmcu=atmega328p -o colours.out colours.c
//   avr-objcopy -O ihex -R .eeprom colours.out colours.hex
//   avrdude -b57600 -patmega328p -cstk500v1 -P/dev/ttyUSB0 -U flash:w:colours.hex

#include <avr/io.h>

void delay(uint16_t ms) {
   uint16_t i,j;
   uint16_t loop = F_CPU / 17000;  // this is approximate and needs calabration.
   for (i=0;i<ms;i++) {
      for (j=0;j<loop;j++);
   }
}

main() {
	 uint8_t dataLights = 0x03;
   uint8_t dataRed = 0x05;
   uint8_t dataGreen = 0x9;
   uint8_t dataBlue = 0x11;

   DDRB |=  (1<<PB2) | (1<<PB3); // make the serial pins output   
   PORTB |= (1<<PB2);  // set the led drivers to recieve input
 
   DDRD |= (1<<PD4); // make the pin for row 4 output
   PORTD &= ~(1<<PD4); // turn that row on.
}
